<template>
  <div class="hy-table">
    <el-table :data="tableData" style="width: 100%">
      <template v-for="item in propList" :key="item.prop">
        <el-table-column v-bind="item">
          <template #default="scope">
            <slot :name="item.slotName">
              {{ scope.row[item.prop] }}
            </slot>
          </template>
        </el-table-column>
      </template>
    </el-table>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
  props: {
    tableData: {
      type: Array,
      require: true
    },
    propList: {
      type: Array
    }
  },
  setup() {
    return {}
  }
})
</script>

<style scoped></style>
